import request from '../utils/request'
// 获取分类列表
export const getCateListAPI = () => {
  return request({
    method: 'GET',
    url: '/my/cate/list'
  })
}
// 添加分类
export const addCateAPI = (addForm) => {
  return request({
    method: 'POST',
    url: '/my/cate/add',
    data: addForm
  })
}
// 根据id获取分类
export const getCateDetailAPI = (id) => {
  return request({
    method: 'GET',
    url: '/my/cate/info',
    params: {
      id
    }
  })
}
// 修改分类
export const updateArtAPI = (editForm) => {
  return request({
    method: 'PUT',
    url: '/my/cate/info',
    data: editForm
  })
}
// 删除
export const delCateAPI = (id) => {
  return request({
    method: 'DELETE',
    url: '/my/cate/del',
    params: {
      id
    }
  })
}
// 发布文章
export const pubArticleAPI = (formData) => {
  return request({
    method: 'POST',
    url: '/my/article/add',
    data: formData
  })
}
// 获取文章
export const initArtListAPI = (q) => {
  return request({
    method: 'GET',
    url: '/my/article/list',
    params: q
  })
}
// 获取文章详情
export const getArtDetailAPI = (id) => {
  return request({
    method: 'GET',
    url: '/my/article/info',
    params: {
      id
    }
  })
}
// 删除文章
export const removeArtAPI = (id) => {
  return request({
    method: 'DELETE',
    url: '/my/article/info',
    params: {
      id
    }
  })
}
